Show:

Q form Class

This tool is meant to be wrapped in a

tag

Constructor

Q form

(
  • $options
)

Parameters:

  • $options Array

    An associative array of parameters, containing:

    • fields Array

      an associative array of fieldname => fieldinfo pairs, where fieldinfo contains the following: "type" => the type of the field (@see Q_Html::smartTag()) "attributes" => additional attributes for the field input "value" => the initial value of the field input "options" => options for the field input (if type is "select", "checkboxes" or "radios") "message" => initial message, if any to put in the field's message space "label" => the label for the field "extra" => if set, this is html to replace the first cell, displacing the label "placeholder" => if set, this is the placeholder text for the input "fillFromRequest" => Defaults to true. If true, uses $_REQUEST to fill any fields with same name. Currently doesn't work for names which specify arrays, such as a[b].

    • [onSubmit] String optional

      Optional. Name of the javascript function or url to pass to Q.handle on submit

    • [onResponse] String optional

      Name of the javascript function or url to pass to Q.handle on response

    • [onSuccess] String optional

      Name of javascript function or url to pass to Q.handle on success

    • [loader] String optional

      Optional. Name of a javascript function which takes (action, method, params, slots, callback) as arguments. It should call the callback and pass it an object with the response info. Can be used to implement caching, etc. instead of the default HTTP request. If "loader" is Q.getter and request should be done bypasing cache, assign true to .ignoreCache property of the tool

    • [slotsToRequest] Array | String optional

      Optional. A string or array of slot names to request in response. Should include "form".

    • [contentElements] Array | String optional

      Optional. Array of $slotName => $cssSelector pairs for child element of the form to fill with HTML returned from the slot.

Item Index